package io.geekidea.springbootplus.system.service.impl;

import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.system.entity.SysBrowse;
import io.geekidea.springbootplus.system.mapper.SysBrowseMapper;
import io.geekidea.springbootplus.system.service.SysBrowseService;
import io.geekidea.springbootplus.system.vo.SysBrowseQueryVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class SysBrowseServiceImpl extends BaseServiceImpl<SysBrowseMapper, SysBrowse> implements SysBrowseService {
    @Autowired
    private SysBrowseMapper sysBrowseMapper;

    @Override
    public List<SysBrowseQueryVo> getSysBrowseList(Integer productId) {
        return sysBrowseMapper.getSysBrowseList(productId);
    }

    @Override
    public boolean saveSysBrowse(SysBrowse sysBrowse) throws Exception {
        return sysBrowseMapper.insert(sysBrowse)>0;
    }
}
